import request from '@/utils/request'

// 获取志愿者列表
export function getVolunteerList(params) {
  return request({
    url: '/volunteer/list',
    method: 'get',
    params
  })
}

// 获取志愿者详情
export function getVolunteerDetail(id) {
  return request({
    url: `/volunteer/${id}`,
    method: 'get'
  })
}

// 添加志愿者
export function addVolunteer(data) {
  return request({
    url: '/volunteer',
    method: 'post',
    data
  })
}

// 更新志愿者信息
export function updateVolunteer(id, data) {
  return request({
    url: '/volunteer',
    method: 'put',
    data: {
      id,
      ...data
    }
  })
}

// 删除志愿者
export function deleteVolunteer(id) {
  return request({
    url: `/volunteer/${id}`,
    method: 'delete'
  })
}

// 批量删除志愿者
export function batchDeleteVolunteer(ids) {
  return request({
    url: '/volunteer/batch',
    method: 'delete',
    data: { ids: ids.split(',').map(Number) }
  })
}

// 更新志愿者状态
export function updateVolunteerStatus(id, status) {
  return request({
    url: '/volunteer/status',
    method: 'put',
    data: { id, status }
  })
} 